﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Expo.Training.DataAccess.Vip;

public partial class Vip_AddLevel : PageBase
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }

    protected void btn_Add_Click(object sender, EventArgs e)
    {
        string _title;
        int _score;

        _title = this.txtTitle.Text.Trim();
        _score = int.Parse(this.txtScore.Text.Trim());

        LevelEntity _model = new LevelEntity();
        _model.Title = _title;
        _model.Score = _score;

        if (VipModule.AddLevel(_model))
        {
            this.AddEndScript("add succes", "alert('添加等级成功！');location.href='LevelManagement.aspx'");
        }
        else
        {
            this.AddEndScript("error", "alert('添加操作出错，请重试！');");
        }

    }
}
